import { useDetail, useList } from "@/hooks";
import { getUserInfoUrl, getUserTypeValue } from "@/command/apiTool";
import { getAction } from "@/command/netTool";
import { ref } from "vue";
export const useRequest = () => {
  const page = ref();
  const position = localStorage.getItem("positionData") as string;
  const positionJSON = JSON.parse(position) as {
    latitude: string;
    longitude: string;
  };
  const [detailinfo] = useDetail(
    getUserInfoUrl(
      {
        dh: "",
        xh: "/api/H5/skill/product/small/myTeamInfo",
      },
      {
        lat: positionJSON.latitude,
        lng: positionJSON.longitude,
      }
    ),
    {
      userId: "",
      name: "",
      address: "",
      distance: "",
      entityComment: "",
      logoUrl: "",
      phone: "",
      title: "",
      workName: "",
      workDay: "",
      workPrice: "",
      userApplyVOList: [],
    }
  );
  // 所种品种
  const [plantTypeList] = useDetail(
    getUserInfoUrl({
      dh: "",
      xh: "/api/H5/skill/product/small/plantType",
    }),
    []
  );
  // 智能推荐
  const [suggestList] = useDetail(
    getUserInfoUrl({
      dh: "/api/H5/skill/product/small/suggest",
      xh: "/api/H5/skill/product/small/suggest",
    }),
    []
  );
  return {
    detailinfo,
    plantTypeList,
    suggestList,
    page,
  };
};
